-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Gallery): add Gallery component #247
base: main
Are you sure you want to change the base?
Conversation
Preview is ready. |
@@ -0,0 +1,18 @@ | |||
import React from 'react'; | |||
|
|||
import {FilePreview} from '../../FilePreview'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to use FIlePreview component from gravity-ui/uikit. Current component will be removed in next major
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need version 6.35.0 of uikit(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/components/FilesGallery/components/VideoFileView/VideoFileView.tsx
Outdated
Show resolved
Hide resolved
src/components/FilesGallery/__stories__/FilesGallery.stories.tsx
Outdated
Show resolved
Hide resolved
@kseniya57 Do we have rfc fo this components? |
Yes |
401a5d6
to
8c07955
Compare
855b632
to
772a07f
Compare
src/components/Gallery/Gallery.tsx
Outdated
const activeItem = items[activeItemIndex] || items[0]; | ||
|
||
if (!items.length) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth considering a empty state. It's strange when the modal just doesn't appear when you try to open it through a prop.
src/components/Gallery/Gallery.scss
Outdated
$filePreviewBlock: '.#{variables.$ns}file-preview'; | ||
|
||
#{$block} { | ||
.g-modal__content-wrapper { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be used var --g-modal-margin
from public css api
src/components/Gallery/Gallery.scss
Outdated
&_mode_full-screen { | ||
overflow: hidden; | ||
|
||
.g-modal__content-wrapper, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be used var --g-modal-border-radius
|
||
import {GalleryFile, files, images} from './mockData'; | ||
|
||
export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be great to see examples of custom actions and a case with а FallbackText in storybook
type: 'document', | ||
url: 'https://preview.gravity-ui.com/icons', | ||
name: 'Html page', | ||
interactive: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<img | ||
className={cnImageView(null, className)} | ||
src={src} | ||
alt="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add alt to the props?
Add the components for rendering galleries (base gallery and the files gallery with file previews and some pre-defined active file renderers)